package edu.zju.gis.dbfg.fileserver.factory;

import edu.zju.gis.dbfg.fileserver.config.BackendFileSystemConfiguration;
import edu.zju.gis.dbfg.fileserver.operator.FileOperator;
import edu.zju.gis.dbfg.fileserver.operator.LocalFileOperator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

@Component
public class FileOperatorFactory {
    @Autowired
    private BackendFileSystemConfiguration fileSystemConfiguration;

    public FileOperator getOpterator() {
        FileOperator opterator = null;
        String fsType = fileSystemConfiguration.getType();
        switch (fsType) {
            case "LOCAL":
                opterator = LocalFileOperator.getInstance();
                break;
        }
        return opterator;
    }
}